package com.xuecheng.test.rabbitmq;

import com.rabbitmq.client.Channel;
import com.xuecheng.test.config.RabbitConfig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created by Aniymx on 2018/12/25 22:10.
 */
@Component
public class ReceiveHandler1 {
    @RabbitListener(queues = {RabbitConfig.QUEUE_INFORM_EMAIL})
    public void email(String msg, Message message, Channel channel){
        System.out.println(msg);
    }

  @RabbitListener(queues = {RabbitConfig.QUEUE_INFORM_SMS})
    public void sms(String msg, Message message, Channel channel){
        System.out.println("sms+"+msg);
    }
}
